<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
	<title> MGEC: Modelling Genetically Engineered Circuits</title>
</head>
<body>
	<h1> MGEC: Modelling Genetically Engineered Circuits</h1>
<b>In synthetic biology researches, people often need to assemble a gene with new promoters to construct new gene circuits so that the target gene can be regulated 
by different transcription factors. Our model build tool allows the biologists who have little modelling experience easily generate a preliminary model for the
constructed gene circuit. They only need to tell which promoter (or regulatory parts in the MIT registry) and gene are assembled. Our tool will automatcally
search in our database to find which transcription factor can bind to the promoter and regulate the expression of the target gene. Alternatively the users can 
directly tell the name of the binding Transcription factor. The users can add many promoter-gene pairs as they want to contruct very complex gene circuits. By 
pressing the "create model" button, a preliminary model in SBML format will be generated. The users can then open the model in software such as Copasi, SimBiology
to further refine the kinetic equation and parameters for better fitting of the experimental data. In the near future, we will add function to allow the users generate
models with different complexity. </b><br/>
<br/>

	<form action="." method="GET">
		<label for="pair"> Input the name of the promoter (or MIT registry regulatory part ID) and the gene assmebled with it. </label><br/>
		<table>
		<tr>	
			<td>Promoter</td>
			<td><input type="text" name="promoter" value="{{ promoter|escape }}"></td></tr>
		<tr><td>gene</td>
			<td><input type="text" name="gene" value="{{ gene|escape }}"></td></tr>
	       </table>
            or type the name of the Transcription factor which can bind to the promoter here <br/>
            <input type="text" name="tf" value="{{ tf|escape }}"><br/>
		<input type="submit" name="igem" value="Add">
		<input type="submit" name="igem" value="Clear ">
		<input type="submit" name="igem" value="Check Model">	
		<input type="submit" name="igem" value="Create Model">	
	</form>
	{% ifequal igem "Add" %}
	{% if operons %}
	<table border="2">
		<thead>
			<tr>
				<th>Transcription factor</th>
				<th>target gene</th>
		</tr>
		</thead>
		<tbody>
			{% for i in operons %}
			<tr>
				{% for e in i %}
				<td>{{e}}</td>
				{% endfor %}
			</tr>
			{% endfor %}
		</tbody>
	</table>
	{% endif %}
	{% endifequal %}
	{% ifequal igem.1 "B" %}
      <b>please be noted that {{igem}} is a modified regulatory part, you may use parameter values different from the natural one!</b>
	{% if operons %}
	<table>
		<thead>
			<tr>
				<th>Transcription factor</th>
				<th>target gene</th>
		</tr>
		</thead>
		<tbody>
			{% for i in operons %}
			<tr>
				{% for e in i %}
				<td>{{e}}</td>
				{% endfor %}
			</tr>
			{% endfor %}
		</tbody>
	</table>
	{% endif %}
	{% endifequal %}
	{% ifequal igem "error" %}
      <b>Cannot find the promoter in the database, please give the name of the transcription factor directly!</b>
	{% endifequal %}	
	{% ifequal igem "error1" %}
      <b>We donot know the transcription factor binding this regulatory part due to the lack of information in the registry.</b>
	{% endifequal %}	
	{% ifequal igem "constitutive" %}
      <b>This is a constitutive promoter, you can directly fix the concentration of the regulated gene!</b>
	{% endifequal %}	
	{% ifequal igem "multi-TF" %}
      <b>This promoter is regulated by multiple transcription factors, we will add support for multi-TF regulation later!</b>
	{% endifequal %}	
	{% ifequal igem "device" %}
      <b>This is actually a device including multiple parts, please find the corresponding regulatory parts!</b>
	{% endifequal %}	
      {% ifequal igem "Check Model" %}
	<table border="2">
		<thead>
			<tr>
				<th>Reaction</th>
				<th>Reaction equation</th>
				<th>Modifier</th>
				<th>Kinetic law</th>
		        </tr>
		</thead>
		<tbody>
			{% for o in operons %}
			<tr>
				<td>Synthesis of {{o.1}}</td>
				<td> = {{o.1}}</td>
				<td>{{o.0}}</td>
				<td>r=v* {{o.0}}^h/(K^h+{{o.0}}^h)</td>
			</tr>
			<tr>
				<td>degradation of {{o.1}}</td>
				<td>{{o.1}} = </td>
				<td> </td>
				<td>r=k*{{o.1}}</td>
			</tr>
			{% endfor %}
		</tbody>
	</table>
	{% endifequal %}

</body>
</html>

